<div class="container-fluid">
    <div class="wrapper">
        <div class="panel" id="nav">
            <div class="panel-heading"><h3 class="panel-title">库存移位记录</h3></div>
            <div class="panel-body">
                <form action="" method="get">
                    <div class="container-fluid">
                        <div class="col-sm-12 col-md-3  add-space">
                            <div class="input-group input-group-md">
                                <span class="input-group-addon">起始储位</span>
                                <input type="text" name="from_storage_position" class="form-control" value="{$Think.get.from_storage_position}">
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-3  add-space">
                            <div class="input-group input-group-md">
                                <span class="input-group-addon">移动SKU</span>
                                <input type="text" name="sku" class="form-control" value="{$Think.get.sku}">
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-3  add-space">
                            <div class="input-group input-group-md">
                                <span class="input-group-addon">到达储位</span>
                                <input type="text" name="to_storage_position" class="form-control" value="{$Think.get.to_storage_position}">
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-3 add-space">
                            <input class="btn btn-primary" type="submit" value="查询">
                        </div>
                    </div>
                </form>
                <div class="clearfix"></div>
                <hr>

                <table class="table table-striped  table-hover" cellspacing="0" width="100%">
                    <thead>
                    <tr>
                        <th>起始储位</th>
                        <th>移动SKU</th>
                        <th>移动数量</th>
                        <th>到达储位</th>
                        <th>移位时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="result" id="val">
                        <tr>
                            <td>{$val.from_storage_position}</td>
                            <td>{$val.sku}</td>
                            <td>{$val.quantity}</td>
                            <td>{$val.to_storage_position}</td>
                            <td>{$val.create_time}</td>
                        </tr>
                    </volist>

                </table>
                <div class="row">
                    <div class="col-md-6 pull-left">
                        <label>每页 20 条记录
                            显示 1 到 20 项，共 {$count}项</label>
                    </div>
                    <div class="col-md-6">
                        <div class="page pull-right" style="padding: 0;margin: 0">
                            {$page}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    /**
     * 下载模板
     */
    function down_template() {
        window.location.href ='__URL__/down_template';
    }

    /**
     * @returns {string}
     * 获取搜索条件
     * khq 2017.3.2
     */
    function search_params(){
        var param = '';
        var storage_position = $("input[name='storage_position']").val();
        var sku = $("input[name='sku']").val();
        var warehouse_date_to = $("input[name='warehouse_date_to']").val();

        if($.trim(storage_position) != ''){
            param += "&storage_position="+$.trim(storage_position);
        }
        if($.trim(sku) != ''){
            param += "&sku="+$.trim(sku);
        }
        if($.trim(warehouse_date_to) != '') {
            param += "&warehouse_date_to="+$.trim(warehouse_date_to);
        }
        return param;
    }
    function download_csv() {
        var param = search_params();
        window.location.href = '__URL__/pandian?downcsv=1' + param;
    }
</script>





